<?php

use think\facade\Route;

//miss路由，定义404
Route::miss(function () {
    @header("http/1.1 404 not found");
    @header("status: 404 not found");
    exit();
});
/**
 * 手机号授权登录
 */
Route::group('login', function () {
    Route::post('miniAppletLogin', 'login/miniAppletLogin');
    Route::post('miniLogin', 'login/miniLogin');
});
/**
 * 其他
 */
Route::group('other', function () {
    Route::get('getCarousel', 'other/getCarousel');
});
/**
 * 购物车
 */
Route::group('cart', function () {
    Route::get('index', 'cart/index');
    Route::post('add', 'cart/add');
    Route::post('edit', 'cart/edit');
    Route::post('submit', 'cart/submit');
})->middleware('verify');
/**
 * 资讯管理
 */
Route::group('news', function () {
    Route::get('getList', 'news/getList');
    Route::get('getMessageList', 'news/getMessageList')->middleware('verify');
    Route::get('info', 'news/info');
});
/**
 * 活动管理
 */
 Route::group('activity', function () {
    Route::get('getList', 'activity/getList');
    Route::get('info', 'activity/info');
    Route::get('getMyList', 'activity/getMyList')->middleware('verify');
    Route::post('submit', 'activity/submit')->middleware('verify');
});
/**
 * 商品管理
 */
Route::group('product', function () {
    Route::get('details', 'product/details');
    Route::get('getList', 'product/getList');
    Route::get('getCateList', 'product/getCateList');
    Route::get('getSpecPrice', 'product/getSpecPrice');
    Route::post('submit', 'product/submit')->middleware('verify');
});
/**
 * 订单
 */
Route::group('order', function () {
    Route::get('index', 'order/index');
    Route::get('payment', 'order/payment');
    Route::get('getList', 'order/getList');
    Route::get('my_order_details', 'order/my_order_details');
    Route::post('submit', 'order/submit');
    Route::post('confirmPayment', 'order/confirmPayment');
    Route::post('edit', 'order/edit');
})->middleware('verify');
/**
 * 会员中心
 */
Route::group('user', function () {
    Route::get('userInfo', 'user/userInfo');
    Route::get('myTaem', 'user/myTaem');
    Route::get('share', 'user/share');
    Route::get('getAccountList', 'user/getAccountList');
    Route::get('getPostulantList', 'user/getPostulantList');
    Route::get('postulantDetails', 'user/postulantDetails');
    Route::post('edit', 'user/edit');
    Route::post('postulantAdd', 'user/postulantAdd');
    Route::post('suggest', 'user/suggest');
})->middleware('verify');
/**
 * 专家团队
 */
 Route::group('team', function () {;
    Route::get('getTeamDetails', 'team/getTeamDetails');
    Route::get('getJobTitle', 'team/getJobTitle');
    Route::get('getExpertList', 'team/getExpertList');
    Route::get('getExpertDetails', 'team/getExpertDetails');
    Route::get('getList', 'team/getList');
    Route::post('expertTeamAdd', 'team/expertTeamAdd');
})->middleware('verify');
/**
 * 方案
 */
Route::group('precept', function () {
    Route::get('getList', 'precept/getList');
    Route::get('getTypeList', 'precept/getTypeList');
    Route::get('getPayInfo', 'precept/getPayInfo');
    Route::get('getComment', 'precept/getComment');
    Route::get('info', 'precept/info');
    Route::get('getUserList', 'precept/getUserList');
    Route::get('getHealthList', 'precept/getHealthList');
    Route::get('getTeamList', 'precept/getTeamList');
    Route::get('statistics', 'precept/statistics');
    Route::get('getCurve', 'precept/getCurve');
    Route::post('save', 'precept/save');
    Route::post('pay', 'precept/pay');
    Route::post('edit', 'precept/edit');
    Route::post('reject', 'precept/reject');
    Route::post('submitEvaluate', 'precept/submitEvaluate');
})->middleware('verify');
/**
 * 地址
 */
Route::group('address', function () {
    Route::get('getList', 'address/getList');
    Route::get('getArea', 'address/getArea');
    Route::get('details', 'address/details');
    Route::post('save', 'address/save');
    Route::post('edit', 'address/edit');
})->middleware('verify');
/**
 * 上传
 */
Route::group('gallery', function () {
    Route::post('/upload', '\addons\Gallery\driver\Gallery@upload');
});

/**
 * 回调
 */
Route::group('callback', function () {
    Route::rule('/autoOssBackup', 'callback/autoOssBackup');
    Route::rule('/statistics', 'callback/statistics');
    Route::rule('/wechatCallback', 'callback/wechatCallback');
    Route::rule('/wechatPreceptOrder', 'callback/wechatPreceptOrder');
    Route::rule('/checkSignature', 'callback/checkSignature');
});
